<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="选择项目类型" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/dtree.css" rel="stylesheet" type="text/css">
<script src="/js/dtree.js"></script>
<script language="javascript">
	function doTreeNodeClick(id){
		var node=d.get(id);
		if(node!=null){
			var arr=node.urlParas;
			parent.popRetVal=arr;
			parent.ClosePop();
		}
	}
	function doCancel(){
		parent.ClosePop();
	}
	function doInit(){
		
	}
</script>
</head>
<body oncontextmenu="return false" onload="doInit();" class="sheet">
<div class="sheet-main" id="bodyDiv" style="width:270px;">
  <div class="sheet-top">
    <div class="content">
      <h2>选择项目类型</h2>
      <p>鼠标单击可以选中记录</p>
    </div>
  </div>
	<div class="sheet-list" style="width:100%">
			  <div align="left" style="width:100%;background:#eafaff;" >					
				<div class="blank12"></div>
						<script language="javascript">
							<!--
							var isOpen=false;
							var d = new dTree('d','/images/dtree');
							
							d.config.useCookies=false;
							d.config.useLines=true;
							d.config.useIcons=true;
							
							d.add(0,-1,'Root');
							var typeName;//c:out是: value="${fn:replace(item.typeName,'\\\\','\\\\\\\\')}";
							//传给doTreeNodeClick时要replace(item.typeName,"\'","\\\\\'"),还要replace(item.typeName,"\"","&#034;"),还要replace(item.typeName,'\\\\','\\\\\\\\'),太麻烦了,换个方式
							<c:forEach var="item" items="${makeTypeList}">
								typeName="${fn:replace(fn:replace(item.typeName,'\\','\\\\'),'\"','\\\"')}";
								d.add(${item.id},${item.parentId},typeName,"javascript:doTreeNodeClick('${item.id}');",'','','',false,false,new Array('${item.id}',typeName,'${item.workCenterId}','<commonTag:showSimpleObjectName list="${workCenterList}" objectId="${item.workCenterId}" />','${item.unit}','${item.type}'));
							</c:forEach>
							
							document.write(d);
							//d.openAll();
							//-->
						</script>
			  </div>
		</div>
</div>	
</body>
</html>